<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});

Route::namespace('App\Api\Controllers')->prefix('v1')->group(function () {
    //公共接口
    Route::group(['prefix'=>'public'], function () {
        //城市地区列表
        Route::post('cityList', 'PublicController@cityList')->name('api.public.cityList');
        //获取七牛云token
        Route::post('qiniuToken', 'PublicController@qiniuToken')->name('api.public.qiniuToken');
    });
    //版块
    Route::group(['prefix'=>'plate'], function () {
        //创建版块
        Route::post('add', 'PlateController@add')->name('api.plate.add');
        //编辑版块
        Route::post('edit', 'PlateController@edit')->name('api.plate.edit');
        //删除版块
        Route::post('del', 'PlateController@del')->name('api.plate.del');
        //关注版块
        Route::post('follow', 'PlateController@follow')->name('api.plate.follow');
        //版块列表
        Route::post('list', 'PlateController@list')->name('api.plate.list');
    });
});
